<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    function* show () {
      console.log("第一个");
      yield '1';
      console.log('第二个');
      yield '2';
      console.log('第三个');
      return '3';
    }
    let rel = show()
    do {
      var flag = rel.next()
      console.log(flag.value, flag.done);
    } while (!flag.done)
    // console.log(rel);
    // let flag = rel.next();
    // console.log(flag);
    // flag = rel.next();
    // console.log(flag);
    // flag = rel.next();
    // console.log(flag);
    // flag = rel.next();
    // console.log(flag);
  </script>
</body>

</html>